home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdb / browser.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-09-06  |  4.9 KB  |  171 lines

  1. VERSION 2.00
  2. Begin Form Browse 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Browse Database"
  5.    ClientHeight    =   4185
  6.    ClientLeft      =   1170
  7.    ClientTop       =   1755
  8.    ClientWidth     =   7200
  9.    ControlBox      =   0   'False
  10.    Height          =   4590
  11.    Left            =   1110
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4185
  17.    ScaleWidth      =   7200
  18.    Top             =   1410
  19.    Width           =   7320
  20.    Begin CommandButton Command3 
  21.       Caption         =   "&Quit"
  22.       Height          =   372
  23.       Left            =   6000
  24.       TabIndex        =   2
  25.       Top             =   3720
  26.       Width           =   1092
  27.    End
  28.    Begin TextBox TimeDisp 
  29.       Height          =   372
  30.       Left            =   5040
  31.       TabIndex        =   9
  32.       Top             =   3720
  33.       Width           =   732
  34.    End
  35.    Begin TextBox RecordStat 
  36.       Height          =   372
  37.       Left            =   2760
  38.       TabIndex        =   7
  39.       Top             =   3720
  40.       Width           =   1092
  41.    End
  42.    Begin TextBox RecordNo 
  43.       Height          =   372
  44.       Left            =   1080
  45.       TabIndex        =   1
  46.       Top             =   3720
  47.       Width           =   732
  48.    End
  49.    Begin TextBox Text1 
  50.       BackColor       =   &H00C0C0C0&
  51.       Enabled         =   0   'False
  52.       Height          =   612
  53.       Left            =   -120
  54.       TabIndex        =   5
  55.       Top             =   3600
  56.       Width           =   7332
  57.    End
  58.    Begin HScrollBar RecordBar 
  59.       Height          =   252
  60.       Left            =   0
  61.       TabIndex        =   4
  62.       Top             =   3360
  63.       Width           =   7212
  64.    End
  65.    Begin TextBox RecordData 
  66.       FontBold        =   -1  'True
  67.       FontItalic      =   0   'False
  68.       FontName        =   "Courier"
  69.       FontSize        =   9.75
  70.       FontStrikethru  =   0   'False
  71.       FontUnderline   =   0   'False
  72.       Height          =   3372
  73.       Left            =   0
  74.       MultiLine       =   -1  'True
  75.       TabIndex        =   0
  76.       Text            =   "Text1"
  77.       Top             =   0
  78.       Width           =   7212
  79.    End
  80.    Begin Label Label3 
  81.       Alignment       =   1  'Right Justify
  82.       BackColor       =   &H00C0C0C0&
  83.       Caption         =   "Time to get record:"
  84.       Height          =   492
  85.       Left            =   3960
  86.       TabIndex        =   8
  87.       Top             =   3720
  88.       Width           =   972
  89.    End
  90.    Begin Label Label2 
  91.       Alignment       =   1  'Right Justify
  92.       BackColor       =   &H00C0C0C0&
  93.       Caption         =   "Record status:"
  94.       Height          =   372
  95.       Left            =   1800
  96.       TabIndex        =   6
  97.       Top             =   3720
  98.       Width           =   852
  99.    End
  100.    Begin Label Label1 
  101.       Alignment       =   1  'Right Justify
  102.       BackColor       =   &H00C0C0C0&
  103.       Caption         =   "This record:"
  104.       Height          =   372
  105.       Left            =   120
  106.       TabIndex        =   3
  107.       Top             =   3720
  108.       Width           =   852
  109.    End
  110. 'Code for Visual Basic 1.0 and Windows 3.0
  111. '(C)1991 Marquis Computing. All Rights Reserved.
  112. 'Database file browser
  113. DefInt A-Z
  114. Dim NumRecs&, Record&
  115. Sub Command3_Click ()
  116.     Unload Browse
  117. End Sub
  118. Sub DisplayRecord (Record&)
  119.        
  120.     '
  121.     'Record browser routine
  122.     '
  123.     Static OldRec&
  124.     If Record& > NumRecs& Then
  125.         Record& = 1
  126.     ElseIf Record& <= 0 Then
  127.         Record& = NumRecs&
  128.     End If
  129.     If Record& <> OldRec& Then
  130.         OldRec& = Record&
  131.         
  132.         InTime# = Timer
  133.         
  134.         GetREC DBFHandle, Status, Record&, RecData$
  135.         
  136.         Outime# = Timer
  137.         TimeDisp.Text = Str$(Outime# - InTime#)
  138.         
  139.         If Left$(RecData$, 1) = "*" Then
  140.             RecordStat.Text = "deleted"
  141.         Else
  142.             RecordStat.Text = "normal"
  143.         End If
  144.         
  145.         RecordData.Text = RecData$
  146.         RecordNo.Text = LTrim$(Str$(Record&))
  147.     End If
  148. End Sub
  149. Sub Form_Load ()
  150.     Screen.MousePointer = 11
  151.     WinWidth = (Screen.Width - Browse.Width) \ 2
  152.     WinHieght = (Screen.Height - Browse.Height) \ 2
  153.     Browse.Move WinWidth, WinHieght
  154.     StatusDBF DBFHandle, FileName$, DBFType$, DBTPtr, NumRecs&, NumFlds, RecLen, UpDate$, Status
  155.     Browse.Caption = "Browsing " + FileName$
  156.     RecordBar.Min = 1
  157.     RecordBar.Max = NumRecs&
  158.     RecordBar.SmallChange = 1
  159.     C = NumRecs& \ 10
  160.     If C = 0 Then C = NumRecs&
  161.     If C = 0 Then C = 1
  162.     RecordBar.LargeChange = C
  163.     Record& = 1
  164.     DisplayRecord Record&
  165.     Screen.MousePointer = 0
  166. End Sub
  167. Sub RecordBar_Change ()
  168.     Record& = RecordBar.Value
  169.     DisplayRecord Record&
  170. End Sub
  171.